package com.example.entity;

import lombok.Data;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

@Data
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Conversations")
public class Conversations {
    @XmlAttribute(name = "xmlns:xsi")
    private String xmlns = "http://www.w3.org/2001/XMLSchema-instance";

    @XmlAttribute(name = "xsi:noNamespaceSchemaLocation")
    private String location = "combi-conversations_v1.2.xsd";

//    @XmlAttribute(name = "License")
//    private String license = "00120-100290-002";

    @XmlElement
    @XmlElementWrapper(name = "Conversation")
    private List<Conversation> conversation = new ArrayList<>();


    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Conversation {



        @XmlElement(name = "StartEpoch")
        private String startEpoch;

        @XmlElement(name = "Subject")
        private String subject;

        @XmlElement(name = "Mode")
        private String mode="Chat";

        @XmlElement(name = "Participants")
        private List<User> participants;






        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class User{
            @XmlElement(name = "UserID")
            private String userID;

            @XmlElement(name = "Email")
            private String email;

            @XmlElement(name = "DisplayName")
            private String displayName;
        }
    }
}